import request from '@/api/request'

// 获取企业商品列表
export const getCompanyGoods = (data) => {
  return request({
    url: '/goods/api/goods/goods/companyId/page',
    method: 'POST',
    data,
  })
}

// 通过id获取企业商品分类
export const getCompanyCategory = (id) => {
  return request({
    url: '/goods/api/goods/category/' + id,
    method: 'GET',
  })
}

// 通过分类获取商品
export const getGoodsListByCategory = (data) => {
  return request({
    url: `/goods/api/category/searchGoods`,
    method: 'POST',
    data,
  })
}

// 通过分类获取商品
export const getGoods = (id) => {
  return request({
    url: `/goods/api/goods/channel/${id}`,
    method: 'GET',
  })
}

// 获取商品评论统计数量
export const getGoodsScore = (id) => {
  return request({
    url: `/order/api/channel/goods/comment/count/${id}`,
    method: 'POST',
  })
}

// 获取商品评论列表
export const getGoodsComment = (data) => {
  return request({
    url: `/order/api/channel/goods/comment/list`,
    method: 'POST',
    data,
  })
}

// 获取商品评论列表
export const getGoodsPrice = (data) => {
  return request({
    url: `/order/api/order/calculate/price`,
    method: 'POST',
    data,
  })
}

// 新增产业链订单
export const addGoodsOrder = (data) => {
  return request({
    url: `/order/order/add`,
    method: 'POST',
    data,
  })
}

// 通过交易号查询订单详情
export const getGoodsByOutTradeNo = (outTradeNo) => {
  return request({
    url: `/order/order/payOrder/view/${outTradeNo}`,
    method: 'GET',
  })
}
